﻿@model EventEditRetrospectModel
@{
    ViewBag.Title = Model.Title;
    var user = ViewBag.User as User;
}
@section Direct{

    @if (user.IsAdministrator())
    {
        <div class="adr">
            <ul>
                <li>@Html.ActionLink("返回", "Detail", new { id = Model.Id })
                </li>
            </ul>
        </div>
    }
}
<section class="ec-add retrospect">
    <div class="form">
        <h3>
            @Model.Title
        </h3>
        @if (Model.Photographs.Count > 0)
        {
            <ul>
                @foreach (var photo in Model.Photographs)
                {
                    <li>
                        <img src="/Assets/Event/@(Model.Id)/@(photo.Path).jpg" alt="@photo.Caption" title="@photo.Caption" />
                        <div>
                            <button onclick="javascript:window.clipboardData.setData('text', '[img]http://' + window.location.host + '/Assets/Event/@(Model.Id)/@(photo.Path).jpg[/img]');if(window.clipboardData.getData('text')) { alert('复制成功'); }">复制</button>
                        </div>
                    </li>
                }
            </ul>
        }

        @using (Html.BeginForm("EditRetrospect", "Event", FormMethod.Post, new { enctype = "multipart/form-data" }))
        {
            <div class="field field-large">
                <div class="editor-label">@Html.LabelFor(model => model.Caption)</div>
                <div class="editor-field">
                    @Html.TextBoxFor(model => model.Caption)
                </div>
            </div>
            <div class="field field-large">
                <div class="editor-field">
                    <input name="tempFile" type="file" />
                    @Html.HiddenFor(model => model.Id)
                </div>
            </div>
            <div class="field action">
                <div class="editor-field">
                    <input type="submit" value="上传" />
                </div>
            </div>
            <div class="field field-large">
                <div class="editor-label">
                    @Html.LabelFor(model => model.Retrospect)
                </div>
                <div class="editor-field">
                    @Html.TextAreaFor(model => model.Retrospect)
                    @Html.ValidationMessageFor(model => model.Retrospect)
                </div>
            </div>
            <div class="field action">
                <div class="editor-field">
                    <input type="submit" value="提交" />
                </div>
            </div>
        }
    </div>
</section>

